﻿using HY.DataAchieve;
using HY.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HY.Service
{
    public class SysModuleService : BaseService
    {
        public int RoleSet(int roleID, List<SysRoleModule> sysRoleModules)
        {
            using (UnitOfWork unit = new UnitOfWork())
            {
                unit.BeginTransaction();
                unit.Dapper().Execute("DELETE SysRoleModule WHERE RoleID=@RoleID", new { RoleID = roleID });
                unit.EF<SysRoleModule>().AddRange(sysRoleModules);
                return unit.Commit();
            }
        }
    }
}
